netstat -an
netstat -ab
netstat -af
netsh advfirewall firewall add rule name="All ICMP V4" dir=in action=allow protocol=icmpv4
netsh advfirewall firewall add rule name="All ICMP V4" dir=in action=block protocol=icmpv4
netsh advfirewall firewall set rule group="remote desktop" new enable=Yes
:: Открыть порт 3389 (Remote Desktop) netsh advfirewall firewall add rule name="Open Remote Desktop" dir=in action=allow protocol=TCP localport=3389 profile=any :: Открыть порт 80 (HTTP) netsh advfirewall firewall add rule name="Open HTTP" dir=in action=allow protocol=TCP localport=80 profile=any :: Открыть порт 443 (HTTPS) netsh advfirewall firewall add rule name="Open HTTPS" dir=in action=allow protocol=TCP localport=443 profile=any :: Закрыть все остальные TCP-порты (входящие) netsh advfirewall firewall add rule name="Block Other TCP" dir=in action=block protocol=TCP localport=1-79,81-442,444-3388,3390-65535 profile=any
netsh advfirewall export "C:\temp\WFconfiguration.wfw"
netsh advfirewall import "C:\temp\WFconfiguration.wfw"
netsh advfirewall set allprofiles state on
netsh advfirewall set allprofiles state off
netsh advfirewall reset